Help with arrays in javascript and php modules

Help with arrays in javascript and php modules

am 04.09.2007 22:54:27 von Leoa

Any help is much appreciated!

My goal is to swap the background image on the tabs in the main menu
of a website.
Becasue this site has a few menus in it, i'd like to use an array to
store the swaped images.

I've been working on it and I made a working example that is close to
what i want.


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


innerHTML
charset=3Dutf-8" />






















However when I put this code in a php module it does not work:


///tabs_3.php ///php module:///////////////////////////////////////////////=
/////////////////////=AD////

/// tabs_3.php ///end of tabs_2.php module:////////////////////////////////=
//////////////////


// header.php
file////////////////////////////////////////////////////////
//this file stores the layout off the tabs
onmouseout=3D"writeScroll2(0)" id=3D"bg_image"> Home

onmouseout=3D"writeScroll(1)" id=3D"bg_image">
Advertisers Agencies


// end of header
file//////////////////////////////////////////////////////// //////////


//
index.php/////////////////////////////////////////////////// ///////////////=
=AD////////////
this file displays the tab menu













/// end of
index.php/////////////////////////////////////////////////// ///////////////=
=AD////

Am i missing something? when I put an alert(); in the tabs_3.php file
I get the alert but no images are displayed.

help plz...

Re: Help with arrays in javascript and php modules

am 05.09.2007 01:22:13 von luiheidsgoeroe

On Tue, 04 Sep 2007 22:54:27 +0200, Leoa wrote:

> Any help is much appreciated!
>
> My goal is to swap the background image on the tabs in the main menu
> of a website.
> Becasue this site has a few menus in it, i'd like to use an array to
> store the swaped images.
>
> I've been working on it and I made a working example that is close to
> what i want.
>
>

Save for the includes I see no PHP anywhere. If it doesn't work, put up
the (output of the) page somewhere, debug that javascript (firebug in
firefox is a great tool for it BTW..) and if you don't find the error ask
in comp.lang.javascript why the javascript doesn't work, accompanied by
the url (they like that, and for good reasons).
--
Rik Wasmus

Re: Help with arrays in javascript and php modules

am 05.09.2007 07:52:04 von Toby A Inkster

Leoa wrote:

> Am i missing something? when I put an alert(); in the tabs_3.php file
> I get the alert but no images are displayed.

You're using relative paths for your images, but I believe you've uploaded
the images relative to the included file instead of relative to the
requested file. Thus the browser can't find them, as it looks for images
relative to the requested file. (The browser doesn't even know that the
included files exist!)

Try using absolute paths for the images, or moving them out of your
include_files directory.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 18:34.]

TrivialEncoder/0.2
http://tobyinkster.co.uk/blog/2007/08/19/trivial-encoder/

Re: Help with arrays in javascript and php modules

am 05.09.2007 17:02:32 von Leoa

On Sep 4, 7:22 pm, "Rik Wasmus" wrote:
> On Tue, 04 Sep 2007 22:54:27 +0200, Leoa wrote:
> > Any help is much appreciated!
>
> > My goal is to swap the background image on the tabs in the main menu
> > of a website.
> > Becasue this site has a few menus in it, i'd like to use an array to
> > store the swaped images.
>
> > I've been working on it and I made a working example that is close to
> > what i want.
>
> Save for the includes I see no PHP anywhere. If it doesn't work, put up
> the (output of the) page somewhere, debug that javascript (firebug in
> firefox is a great tool for it BTW..) and if you don't find the error ask
> in comp.lang.javascript why the javascript doesn't work, accompanied by
> the url (they like that, and for good reasons).
> --
> Rik Wasmus

Thank you! Thank you! Thank you! Rik! Firebug was a huge help! I
figured it out. Thanks soo much!